cur_site=2;
data=[];
for tnd=1:size(proj_meta(cur_site).rd,2)
    cnt=0;
    for hnd=1:4
        figure(hnd);hold on
        tmp=proj_meta(cur_site).rd(hnd,tnd).act;
%         tmp(tmp<2)=0;
        cur_data=max(tmp,[],2);
        plot(cur_data,'color',[1 1 1]*(1-tnd/7))
%         cur_data=mean(proj_meta(cur_site).rd(hnd,tnd).act,2);
%         data(cnt+1:cnt+size(proj_meta(cur_site).rd(hnd,tnd).act,1),tnd)=mean(proj_meta(cur_site).rd(hnd,tnd).act,2);        
%         data(cnt+1:cnt+size(proj_meta(cur_site).rd(hnd,tnd).act,1),tnd)=sum(proj_meta(cur_site).rd(hnd,tnd).act,2);
%         data(cnt+1:cnt+size(proj_meta(cur_site).rd(hnd,tnd).act,1),tnd)=cur_data/max(cur_data);
        data(cnt+1:cnt+size(proj_meta(cur_site).rd(hnd,tnd).act,1),tnd)=cur_data;
        cnt=cnt+size(proj_meta(cur_site).rd(hnd,tnd).act,1);
    end
end

res=[];
for tnd=1:size(proj_meta(cur_site).rd,2)
    cur_day=data(:,tnd);
    for hnd=1:size(proj_meta(cur_site).rd,2)
        res(hnd,tnd)=corr(cur_day,data(:,hnd));
    end
end

figure;imagesc(res)
colorbar
set(gca,'clim',[0 1])